<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-dayManage-add">
        <div class="col-md-6 form-group">
            <label class="col-sm-3 control-label">日程类型：</label>
            <div class="col-sm-8">
                <select name="dayType" class="form-control m-b" th:with="type=${@dict.getType('oa_daymanage_type')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>
        <div class="col-md-6 form-group">
            <label class="col-sm-3 control-label">日程状态：</label>
            <div class="col-sm-8">
                <select name="status" class="form-control m-b" th:with="type=${@dict.getType('oa_daymanage_status')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>
        <div class="col-md-6 form-group">
            <label class="col-sm-3 control-label">开始时间：</label>
            <div class="col-sm-8">
                <input id="startTime" name="startTime" class="select-datetime form-control" type="text" placeholder="开始时间">
            </div>
        </div>
        <div class="col-md-6 form-group">
            <label class="col-sm-3 control-label">结束时间：</label>
            <div class="col-sm-8">
                <input id="endTime" name="endTime" class="select-datetime form-control" type="text" placeholder="开始时间">
            </div>
        </div>
        <div class="col-md-6 form-group">
            <label class="col-sm-3 control-label">日程标题：</label>
            <div class="col-sm-8">
                <input id="dayTitle" name="dayTitle" class="form-control" type="text">
            </div>
        </div>
        <div class="col-md-6 form-group">
            <label class="col-sm-3 control-label">是否提醒：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
                    <input type="radio" th:id="${dict.dictCode}" name="remind" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
                    <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
        <div class="col-md-6 form-group">
            <label class="col-sm-3 control-label">共享人：</label>
            <div class="col-sm-8">
                <input name="userIds"  type="hidden" id="userIds"/>
                <input name="loginNames"  type="hidden" id="loginNames"/>
                <input class="form-control" type="text" name="userNames" onclick="selectDeptTree()" readonly="true" id="userNames">
            </div>
        </div>
        <div class="col-md-6 form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea name="remark" id="remark" class="form-control"></textarea>
            </div>
        </div>
        <div class="col-md-12 form-group">
            <div class="form-control-static col-sm-offset-9">
                <button type="submit" class="btn btn-primary">提交</button>
                <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
            </div>
        </div>
    </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
    var prefix = ctx + "oa/daymanage";
    $("#form-dayManage-add").validate({
        rules: {
            dayTitle: {
                required: true,
            },
        }
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-dayManage-add').serialize());
        }
    }
    /*用户管理-新增-选择部门树*/
    function selectDeptTree() {
        var url = ctx + "system/user/userTree";
        $.modal.open("选择共享人", url);
    }
    function loadUser(userId,userName,loginNames) {
        $("#userNames").val(userName);
        $("#userIds").val(userId);
        $("#loginNames").val(loginNames);
    }
</script>
</body>
</html>